package com.cyf.smartCity.service.impl;

import com.cyf.db.mapper.smartCity.SendDataMapper;
import com.cyf.smartCity.bean.SendData;
import com.cyf.smartCity.service.SendDataService;
import com.cyf.util.TableNameUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author hfy
 * @date 2018/11/23
 */
@Slf4j
@Service
public class SendDataServiceImpl implements SendDataService {

    @Autowired
    private SendDataMapper sendDataMapper;

    @Override
    public void insert(Class clazz, Integer cloudId, Integer localId, Integer parkingId, Integer optType) {
        SendData sendData = new SendData();
        sendData.setTableName(TableNameUtil.getTableName(clazz));
        sendData.setCloudId(cloudId);
        sendData.setLocalId(localId);
        sendData.setParkingId(parkingId);
        sendData.setOptType(optType);
        sendDataMapper.insert(sendData);
    }
}
